home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.2 for Intel / NeXTSTEP 3.2 for Intel.iso / NextLibrary / Documentation / Sybase / DBLIB / Section2 / dbcount.nr < prev    next >
Encoding:
Text File  |  1993-04-22  |  1.3 KB  |  51 lines

  1. .Na "DBCOUNT" 
  2. .Aa
  3. .Fu
  4. Return the number of rows affected by a \*N command.
  5. .Ih "rows, returning the number affected by a command"
  6. .Sy
  7. .Sf "DBINT DBCOUNT(dbproc)"
  8. .Sp "DBPROCESS" "*dbproc"
  9. .Co
  10. .Bl
  11. Once the results of a command have been processed, you can call
  12. .I "DBCOUNT()"
  13. to find out how many rows were affected by the command.  For example, if
  14. a SELECT 
  15. command was sent to \*S and you have read all the rows by calling
  16. .I "dbnextrow()"
  17. until it returned NO_MORE_ROWS, you 
  18. can call this macro to find out how many rows were
  19. retrieved.
  20. .Bl
  21. If the current command is one that doesn't return rows, 
  22. (\f2e.g.,\f1 a DELETE), you can call
  23. .I "DBCOUNT()"
  24. immediately after 
  25. .I "dbresults()."
  26. .Bz
  27. .Pa
  28. .Pi dbproc
  29. A pointer to the DBPROCESS structure that provides the connection
  30. for a particular front-end/\*S process.  It contains all the
  31. information that \*L uses to manage communications and data between the
  32. front end and \*S.
  33. .in -.375i
  34. .Re
  35. .mc |
  36. .br
  37. The number of rows affected by the command, or -1.
  38. \f2DBCOUNT()\f1 will return -1 if any of the following are true:
  39. .Bl
  40. The \*N command fails for any reason, such as a syntax error.
  41. .Bl
  42. The command is one that \f2never\f1 affects rows, such as a PRINT command.
  43. .Bl
  44. The DBNOCOUNT option is on.
  45. .Bz
  46. .mc
  47. .Sa
  48. dbnextrow,
  49. dbresults,
  50. options
  51.